package system
/**
 * 机构类型
 */
class DepartmentType {
    String name
    Date dateCreated//创建时间
    Date lastUpdated//最后更新的时间
    static constraints = {
        dateCreated nullable: true
        lastUpdated nullable: true
    }
    static mapping = {
        version false
    }
    transient utilsService

    def buildDomain() {
        def b = [:] + this.properties
        b.remove('status')
        def param = [allowformat: true]
        b = utilsService.truncProp(this, b, param) { amap ->
            amap << ['id': this.id]
        }
        b
    }

    def buildDomainList(list) {
        def rds = []
        list.each {
            def b = [:] + it.properties
            b.remove('status')
            def param = [allowformat: true]
            b = utilsService.truncProp(it, b, param) { amap ->
                amap << ['id': it.id]

            }
            rds << b
        }
        return rds
    }
}
